package com.lagou.demo.controller;

import com.lagou.demo.service.IDemoService;
import com.lagou.edu.mvcframework.annotations.LagouAutowired;
import com.lagou.edu.mvcframework.annotations.LagouController;
import com.lagou.edu.mvcframework.annotations.LagouRequestMapping;
import com.lagou.edu.mvcframework.annotations.Security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author czq
 * @date 2020/7/12 22:54
 */
@LagouController
@LagouRequestMapping("/demo")
@Security({"czq", "shitou", "kele"})
public class DemoController {

    @LagouAutowired
    private IDemoService demoService;

    /**
     * URL：/demo/query
     * @param request
     * @param response
     * @return
     */
    @LagouRequestMapping("/query")
    public void query(HttpServletRequest request, HttpServletResponse response) throws IOException {
        response.setContentType("text/html;charset=utf-8");
        response.getWriter().write("访问成功");
    }
}
